package edu.cqie.dao;

import edu.cqie.entity.User;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * UserDao1Impl
 *
 * @description:
 * @Author XiaoZhou
 * @Date 2023/10/18 15:28
 */
public class UserDao2Impl extends SqlSessionDaoSupport implements UserDao2 {
    @Override
    public List<User> selectUser() {
        User user = new User(7, "先辈", "123456");

        UserDao2 mapper = getSqlSession().getMapper(UserDao2.class);

        mapper.addUser(user);
        mapper.deleteUser(1);
        return mapper.selectUser();
    }

    @Override
    public int addUser(User user) {
        return getSqlSession().getMapper(UserDao2.class).addUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return getSqlSession().getMapper(UserDao2.class).deleteUser(id);
    }

    @Override
    public User queryById(Integer id) {
        return null;
    }

    @Override
    public List<User> queryAllByLimit(User user, Pageable pageable) {
        return null;
    }

    @Override
    public long count(User user) {
        return 0;
    }

    @Override
    public int insert(User user) {
        return 0;
    }

    @Override
    public int insertBatch(List<User> entities) {
        return 0;
    }

    @Override
    public int insertOrUpdateBatch(List<User> entities) {
        return 0;
    }

    @Override
    public int update(User user) {
        return 0;
    }

    @Override
    public int deleteById(Integer id) {
        return 0;
    }
}
